//
//  GreenBeanDetaiilCel.m
//  LvXi_newVersion
//
//  Created by 王敏 on 16/9/23.
//  Copyright © 2016年 SJT. All rights reserved.
//

#import "GreenBeanDetaiilCel.h"

@implementation GreenBeanDetaiilCel
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){

        
        UILabel * typeLabel = [UILabel labelWithTextColor:[UIColor blackColor] font:[UIFont systemFontOfSize:14]];
        UILabel * timeLabel = [UILabel labelWithTextColor:HexColor(@"#AAAAAA") font:[UIFont systemFontOfSize:12]];
        UILabel * greenBeanLabel = [UILabel labelWithTextColor:RGBColor(238,185,110) font:[UIFont systemFontOfSize:12]];
        
        [self.contentView addSubview:typeLabel];
        [self.contentView addSubview:timeLabel];
        [self.contentView addSubview:greenBeanLabel];
        self.typeLabel = typeLabel;
        self.timeLabel = timeLabel;
        self.greenBeanLabel = greenBeanLabel;
        self.cellHeight = MineRatio(50);
        [self setBackgroundImageViewHeight:self.cellHeight];
    }
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    self.typeLabel.size = [self.typeLabel textSize];
    self.timeLabel.size = [self.timeLabel textSize];
    self.greenBeanLabel.size = [self.greenBeanLabel textSize];
    
    self.typeLabel.y = globalMargin;
    self.typeLabel.x = 2* globalMargin;
    
    self.timeLabel.y = self.typeLabel.botton + globalMargin*0.5;
    self.timeLabel.x = self.typeLabel.x;
    
    self.greenBeanLabel.x = ScreenWidth - self.greenBeanLabel.width - 2*globalMargin;
    self.greenBeanLabel.centerY = self.cellHeight*0.5;
}
@end
